﻿<%@ page import="fr.web325.bean.Notice" %>
<%@ page import="fr.web325.dao.ClientDao" %>
<%@ page import="java.sql.SQLException" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
	<meta charset="utf-8">
	<meta name="description" content="">
	<meta name="keywords" content="手机 电视">
	<title>传智书城</title>
	<%@ include file="style.jsp" %>
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/shop/client/css/index.css" />
	<!-- 引入 layui.css -->
	<script src="${pageContext.request.contextPath}/shop/client/js/jquery-1.12.4.js" type="text/javascript"></script>
</head>

<body>
<%@ include file="start.jsp" %>
	<!--  导航 end -->
<%@ include file="header.jsp" %>
	<!--  header end -->
	<!-- 中间分类  start -->
	<div class="w grid" style="margin-bottom: 50px;">
		<div class="grid-l fl" style="border-radius: 10px 0px 0px 10px;">
			<ul class="hotbook">
				<h4 style="text-align: center;"><img src="${pageContext.request.contextPath}/shop/client/images/hottitle.gif" alt=""></h4>
				<li>
					<a href="${pageContext.request.contextPath}/shop/client/book?id=${hotList[0].id}">
						<img src="${pageContext.request.contextPath}/shop/client/${hotList[0].imgurl}" alt="${hotList[0].name}" style="width: 86px;height: 120px;">
					</a>
				</li>
				<span>${hotList[0].name}</span>
				<li>
					<a href="${pageContext.request.contextPath}/shop/client/book?id=${hotList[1].id}">
						<img src="${pageContext.request.contextPath}/shop/client/${hotList[1].imgurl}" alt="${hotList[1].name}" style="width: 86px;height: 120px;">
					</a>
				</li>
				<span>${hotList[1].name}</span>
				<li>
					<a href="${pageContext.request.contextPath}/shop/client/book?id=${hotList[2].id}">
						<img src="${pageContext.request.contextPath}/shop/client/${hotList[2].imgurl}" alt="${hotList[2].name}" style="width: 86px;height: 120px;">
					</a>
				</li>
				<span>${hotList[2].name}</span>
			</ul>
		</div>
		<div class="grid-c fl">
			<div class="grid-pic-l" style="overflow: hidden;">
				<div class="layui-carousel" id="test1">
					<div carousel-item>
						<div><a href="javascript:;"><img src="${pageContext.request.contextPath}/shop/client/images/index_ad.jpg" alt=""></a></div>
						<div><a href="javascript:;"><img src="${pageContext.request.contextPath}/shop/client/images/index_ad0.jpg" alt=""></a></div>
						<div><a href="javascript:;"><img src="${pageContext.request.contextPath}/shop/client/images/index_ad1.jpg" alt=""></a></div>
						<div><a href="javascript:;"><img src="${pageContext.request.contextPath}/shop/client/images/index_ad2.jpg" alt=""></a></div>
					</div>
				</div>
			</div>
		</div>
		<!-- 登陆模块 -->
		<div class="grid-l fr" style="border-radius: 0px 10px 10px 0px">
			<div class="login">
				<div class="aaa">
					<div class="login-user">
						<a href=""><img src="${pageContext.request.contextPath}/shop/client/images/user.jpg"></a>
					</div>
				</div>
				<p style="margin-bottom: 27px;">Hi~欢迎来到传智书城！</p>
				<c:set var="str" value="<a href=\"${pageContext.request.contextPath}/shop/client/mine\" style=\"color:#ce2020;\">个人中心</a>" />
				<c:set var="str2" value="<p><a href=\"${pageContext.request.contextPath}/shop/client/login.jsp\">登陆</a><a href=\"${pageContext.request.contextPath}/shop/client/register.jsp\">注册</a></p>" />
			${sessionScope.user == null?str2: str}
			</div>
			<div class="new">
				<div>
					<div class="new-shop">
						<a href="">公告</a>
						<a href="" class="new-shopcu">促销</a>
						<div class="new-border"></div>
					</div>
					<div class="new-p">
						<%
							try {
								Notice notice= new ClientDao().getNewNotice();
								pageContext.setAttribute("notice",notice);
							} catch (SQLException e) {
								e.printStackTrace();
							}
						%>
						<p style="font-size:5px;">
							${notice.details}</p>
					</div>
				</div>
			</div>
		</div>

	</div>
	<!--  footer start -->
<%@include file="footer.jsp"%>
	<!-- 引入 layui.js -->
	<script>
		layui.use('carousel', function () {
			var carousel = layui.carousel;
			//建造实例
			carousel.render({
				elem: '#test1'
				, width: '100%' //设置容器宽度
				, height: '100%'
				, arrow: 'hover+' //始终显示箭头
			});
		});
	</script>
</body>

</html>